CREATE OR REPLACE FUNCTION createFunction_9ae1806e-a12f-42d5-bcf5-a5f83aabf529() RETURNS TRIGGER AS
$$
DECLARE
BEGIN
new.work_year := 0;
new.work_year := 1;
WHILE new.work_year > 0 LOOP
	new.work_year := new.work_year - 1;
END LOOP;
LOOP
    new.work_year := new.work_year + 1;
	IF new.work_year > 10 THEN
		EXIT;
    END IF;
END LOOP;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER tr_before_insert_employee
    BEFORE UPDATE ON t_employee
    FOR EACH ROW
    EXECUTE PROCEDURE createFunction_9ae1806ea12f42d5bcf5a5f83aabf529();